package javaBase.ReCurese;

/**
 * @program: jvm
 * @description
 * @author: tkk fendoukaoziji
 * @create: 2019-05-04 11:10
 **/
public class CalNum {
    public static void main(String[] args) {
        int i = reCal(5);
        System.out.println(i);
    }

    private static int reCal(int i) {
        System.out.println("输入i"+i);
        if(i==1){
            return 1;
        }else{
            int temp=i+reCal(i-1);
            System.out.println("return temp"+temp);
            return temp;
        }
    }
}
